home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 6 / Amiga Format AFCD06 (Nov 1996, Issue 90).iso / serious / commercial / cloanto / colortype / rexx / dviewtext.ctrx < prev    next >
Text File  |  1996-04-11  |  1KB  |  58 lines

  1. /* ColorType Amiga Rexx script - Copyright © 1996 Cloanto Italia srl */
  2.  
  3. /* $VER: DViewText.ctrx 1.0 */
  4.  
  5. /**
  6.  This script fills the Dynamic View area with all of the font's characters.
  7.  This is useful to preview editing effects in real time. Undefined
  8.  characters and characters switched to "Off" are skipped.
  9. */
  10.  
  11. IF ARG(1, EXISTS) THEN
  12.     PARSE ARG CTPORT
  13. ELSE
  14.     CTPORT = 'COLORTYPE'
  15.  
  16. IF ~SHOW('P', CTPORT) THEN DO
  17.     IF EXISTS('ColorType:ColorType') THEN DO
  18.         ADDRESS COMMAND 'Run >NIL: ColorType:ColorType'
  19.         DO 30 WHILE ~SHOW('P',CTPORT)
  20.              ADDRESS COMMAND 'Wait >NIL: 1 SEC'
  21.         END
  22.     END
  23.     ELSE DO
  24.         SAY "ColorType could not be loaded."
  25.         EXIT 10
  26.     END
  27. END
  28.  
  29. IF ~SHOW('P', CTPORT) THEN DO
  30.     SAY 'ColorType Rexx port could not be opened.'
  31.     EXIT 10
  32. END
  33.  
  34. ADDRESS VALUE CTPORT
  35. OPTIONS RESULTS
  36. OPTIONS FAILAT 10000
  37.  
  38.  
  39. LockGUI
  40. len = 0
  41. DO cn = 0 to 255
  42.     GetActivation cn
  43.     IF RESULT = 1 THEN DO
  44.         IF len = 0 THEN
  45.             dvtext = D2C(cn)
  46.         ELSE
  47.             dvtext = dvtext || D2C(cn)
  48.         IF cn = 34 THEN
  49.             dvtext = dvtext || D2C(cn)    /* '"' -> '""' */
  50.         len = len + 1
  51.     END
  52. END
  53.  
  54. IF len > 0 THEN
  55.     DynamicView '"'dvtext'"'
  56.  
  57. UnlockGUI
  58.